package com.tianzhu.domain;

import static javax.persistence.FetchType.EAGER;

import java.io.Serializable;

import javax.persistence.*;


/**
 * The persistent class for the GROUP_MEMBERS database table.
 * 
 */
@Entity
@Table(name="GROUP_MEMBERS")
@NamedQuery(name="GroupMember.findAll", query="SELECT g FROM GroupMember g")
public class GroupMember implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="GROUP_MEMBERS_ID_GENERATOR", sequenceName="GROUP_MEMBERS_S")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="GROUP_MEMBERS_ID_GENERATOR")
	@Column(unique=true, nullable=false, precision=38)
	private Long id;

	@Column(name="USERNAME",nullable=false)
	private String username;

	//bi-directional many-to-one association to Group
	@ManyToOne(fetch = EAGER)
	@JoinColumn(name="GROUP_ID", nullable=false)
	private Group group;

	public GroupMember() {
	}

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public Group getGroup() {
		return this.group;
	}

	public void setGroup(Group group) {
		this.group = group;
	}

}